Filter hook 'rest_{$this->taxonomy}_query'

in WP Core File wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php at line 318

Description

Filters get_terms() arguments when querying terms via the REST API. The dynamic portion of the hook name, `$this->taxonomy`, refers to the taxonomy slug. Possible hook names include: - `rest_category_query` - `rest_post_tag_query` Enables adding extra arguments or setting defaults for a terms collection request.

Occurrences

Filename Line Number
wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php 318

Parameters

Type Name Description
array $prepared_args Array of arguments for get_terms().
WP_REST_Request $request The REST API request.

PHP Doc

/**
		 * Filters get_terms() arguments when querying terms via the REST API.
		 *
		 * The dynamic portion of the hook name, `$this->taxonomy`, refers to the taxonomy slug.
		 *
		 * Possible hook names include:
		 *
		 *  - `rest_category_query`
		 *  - `rest_post_tag_query`
		 *
		 * Enables adding extra arguments or setting defaults for a terms
		 * collection request.
		 *
		 * @since 4.7.0
		 *
		 * @link https://developer.wordpress.org/reference/functions/get_terms/
		 *
		 * @param array           $prepared_args Array of arguments for get_terms().
		 * @param WP_REST_Request $request       The REST API request.
		 */